//
//  DFAlertView.m
//  换换圈
//
//  Created by 艾柯斯 on 14-12-8.
//  Copyright (c) 2014年 艾柯斯. All rights reserved.
//

#import "DFAlertView.h"

typedef void (^ClickedButtonBlock)(NSInteger buttonIndex);


@interface DFAlertView() <UIAlertViewDelegate> {
    ClickedButtonBlock _clickedButton;
}

@end

@implementation DFAlertView


-(void)showWithClickedButton:(void (^)(NSInteger))clickedButton {
    self.delegate = self;
    _clickedButton = clickedButton;
    
    [self show];
}

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if(_clickedButton) {
        _clickedButton(buttonIndex);
    }
}

@end
